<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDeclarativeProperty Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDeclarativeProperty Class Reference<br /><sup><sup>[<a href="qtdeclarative.html">QtDeclarative</a> module]</sup></sup></h1><p>The QDeclarativeProperty class abstracts accessing properties on
objects created from QML. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdeclarativeproperty.html#PropertyTypeCategory-enum">PropertyTypeCategory</a></b> { InvalidCategory, List, Object, Normal }</li><li><div class="fn" />enum <b><a href="qdeclarativeproperty.html#Type-enum">Type</a></b> { Invalid, Property, SignalProperty }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-2">__init__</a></b> (<i>self</i>, QObject)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-3">__init__</a></b> (<i>self</i>, QObject, QDeclarativeContext)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-4">__init__</a></b> (<i>self</i>, QObject, QDeclarativeEngine)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-5">__init__</a></b> (<i>self</i>, QObject, QString)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-6">__init__</a></b> (<i>self</i>, QObject, QString, QDeclarativeContext)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-7">__init__</a></b> (<i>self</i>, QObject, QString, QDeclarativeEngine)</li><li><div class="fn" /><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-8">__init__</a></b> (<i>self</i>, QDeclarativeProperty)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#connectNotifySignal">connectNotifySignal</a></b> (<i>self</i>, QObject&#160;<i>dest</i>, SLOT()SLOT()&#160;<i>slot</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#connectNotifySignal-2">connectNotifySignal</a></b> (<i>self</i>, callable&#160;<i>dest</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#connectNotifySignal-3">connectNotifySignal</a></b> (<i>self</i>, QObject&#160;<i>dest</i>, int&#160;<i>method</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#hasNotifySignal">hasNotifySignal</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdeclarativeproperty.html#index">index</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isDesignable">isDesignable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isProperty">isProperty</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isResettable">isResettable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isSignalProperty">isSignalProperty</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#isWritable">isWritable</a></b> (<i>self</i>)</li><li><div class="fn" />QMetaMethod <b><a href="qdeclarativeproperty.html#method">method</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qdeclarativeproperty.html#name">name</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#needsNotifySignal">needsNotifySignal</a></b> (<i>self</i>)</li><li><div class="fn" />QObject <b><a href="qdeclarativeproperty.html#object">object</a></b> (<i>self</i>)</li><li><div class="fn" />QMetaProperty <b><a href="qdeclarativeproperty.html#property">property</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdeclarativeproperty.html#propertyType">propertyType</a></b> (<i>self</i>)</li><li><div class="fn" />PropertyTypeCategory <b><a href="qdeclarativeproperty.html#propertyTypeCategory">propertyTypeCategory</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qdeclarativeproperty.html#propertyTypeName">propertyTypeName</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qdeclarativeproperty.html#read">read</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" />Type <b><a href="qdeclarativeproperty.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#write">write</a></b> (<i>self</i>, QVariant)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QVariant <b><a href="qdeclarativeproperty.html#read-2">read</a></b> (QObject, QString)</li><li><div class="fn" />QVariant <b><a href="qdeclarativeproperty.html#read-3">read</a></b> (QObject, QString, QDeclarativeContext)</li><li><div class="fn" />QVariant <b><a href="qdeclarativeproperty.html#read-4">read</a></b> (QObject, QString, QDeclarativeEngine)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#write-2">write</a></b> (QObject, QString, QVariant)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#write-3">write</a></b> (QObject, QString, QVariant, QDeclarativeContext)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#write-4">write</a></b> (QObject, QString, QVariant, QDeclarativeEngine)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#__eq__">__eq__</a></b> (<i>self</i>, QDeclarativeProperty)</li><li><div class="fn" />int <b><a href="qdeclarativeproperty.html#__hash__">__hash__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeproperty.html#__ne__">__ne__</a></b> (<i>self</i>, QDeclarativeProperty)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDeclarativeProperty class abstracts accessing properties on
objects created from QML.</p>
<p>As QML uses Qt's meta-type system all of the existing <a href="qmetaobject.html">QMetaObject</a> classes can be used to
introspect and interact with objects created by QML. However, some
of the new features provided by QML - such as type safety and
attached properties - are most easily used through the
QDeclarativeProperty class that simplifies some of their natural
complexity.</p>
<p>Unlike <a href="qmetaproperty.html">QMetaProperty</a> which
represents a property on a class type, QDeclarativeProperty
encapsulates a property on a specific object instance. To read a
property's value, programmers create a QDeclarativeProperty
instance and call the <a href="qdeclarativeproperty.html#read">read</a>() method. Likewise to
write a property value the <a href="qdeclarativeproperty.html#write">write</a>() method is used.</p>
<p>For example, for the following QML code:</p>
<pre class="qml">
 <span class="comment">// MyItem.qml</span>
 import QtQuick 1.0

 <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="string">"A bit of text"</span> }
</pre>
<p>The <a href="qml-text.html">Text</a> object's properties could
be accessed using QDeclarativeProperty, like this:</p>
<pre class="cpp">
 <span class="preprocessor">#include &lt;QDeclarativeProperty&gt;</span>
 <span class="preprocessor">#include &lt;QGraphicsObject&gt;</span>

 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

 <span class="type"><a href="qdeclarativeview.html">QDeclarativeView</a></span> view(<span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">.</span>fromLocalFile(<span class="string">"MyItem.qml"</span>));
 <span class="type">QDeclarativeProperty</span> <a href="qdeclarativeproperty.html#property">property</a>(view<span class="operator">.</span>rootObject()<span class="operator">,</span> <span class="string">"font.pixelSize"</span>);
 <a href="qtcore.html#qWarning">qWarning</a>() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">"Current pixel size:"</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> property<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>()<span class="operator">.</span>toInt();
 property<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(<span class="number">24</span>);
 <a href="qtcore.html#qWarning">qWarning</a>() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">"Pixel size should now be 24:"</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> property<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>()<span class="operator">.</span>toInt();
</pre><hr /><h2>Type Documentation</h2><h3 class="fn"><a name="PropertyTypeCategory-enum" />QDeclarativeProperty.PropertyTypeCategory</h3><p>This enum specifies a category of QML property.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QDeclarativeProperty.InvalidCategory</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The property is invalid, or is a signal
property.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeProperty.List</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The property is a <a href="qdeclarativelistproperty.html">QDeclarativeListProperty</a> list
property</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeProperty.Object</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The property is a <a href="qobject.html">QObject</a> derived type pointer</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeProperty.Normal</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The property is a normal value property.</td>
</tr>
</table>


<h3 class="fn"><a name="Type-enum" />QDeclarativeProperty.Type</h3><p>This enum specifies a type of QML property.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeProperty.Invalid</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The property is invalid.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeProperty.Property</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The property is a regular Qt property.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDeclarativeProperty.SignalProperty</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The property is a signal property.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDeclarativeProperty" />QDeclarativeProperty.__init__ (<i>self</i>)</h3><p>Create an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>.</p>


<h3 class="fn"><a name="QDeclarativeProperty-2" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
default property of <i>obj</i>. If there is no default property, an
invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be
created.</p>


<h3 class="fn"><a name="QDeclarativeProperty-3" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, <a href="qdeclarativecontext.html">QDeclarativeContext</a>)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
default property of <i>obj</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>. If there is no
default property, an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be
created.</p>


<h3 class="fn"><a name="QDeclarativeProperty-4" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, <a href="qdeclarativeengine.html">QDeclarativeEngine</a>)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
default property of <i>obj</i> using the environment for
instantiating QML components that is provided by <i>engine</i>. If
there is no default property, an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be
created.</p>


<h3 class="fn"><a name="QDeclarativeProperty-5" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, QString)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
property <i>name</i> of <i>obj</i>.</p>


<h3 class="fn"><a name="QDeclarativeProperty-6" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, QString, <a href="qdeclarativecontext.html">QDeclarativeContext</a>)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
property <i>name</i> of <i>obj</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>.</p>
<p>Creating a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> without a
context will render some properties - like attached properties -
inaccessible.</p>


<h3 class="fn"><a name="QDeclarativeProperty-7" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, QString, <a href="qdeclarativeengine.html">QDeclarativeEngine</a>)</h3><p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the
property <i>name</i> of <i>obj</i> using the environment for
instantiating QML components that is provided by <i>engine</i>.</p>


<h3 class="fn"><a name="QDeclarativeProperty-8" />QDeclarativeProperty.__init__ (<i>self</i>, <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>)</h3><p>Create a copy of <i>other</i>.</p>


<h3 class="fn"><a name="connectNotifySignal" />bool QDeclarativeProperty.connectNotifySignal (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>dest</i>, SLOT()SLOT()&#160;<i>slot</i>)</h3><p>Connects the property's change notifier signal to the specified
<i>slot</i> of the <i>dest</i> object and returns true. Returns
false if this metaproperty does not represent a regular Qt property
or if it has no change notifier signal, or if the <i>dest</i>
object does not have the specified <i>slot</i>.</p>


<h3 class="fn"><a name="connectNotifySignal-2" />bool QDeclarativeProperty.connectNotifySignal (<i>self</i>, callable&#160;<i>dest</i>)</h3><p>Connects the property's change notifier signal to the specified
<i>method</i> of the <i>dest</i> object and returns true. Returns
false if this metaproperty does not represent a regular Qt property
or if it has no change notifier signal, or if the <i>dest</i>
object does not have the specified <i>method</i>.</p>


<h3 class="fn"><a name="connectNotifySignal-3" />bool QDeclarativeProperty.connectNotifySignal (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>dest</i>, int&#160;<i>method</i>)</h3><h3 class="fn"><a name="hasNotifySignal" />bool QDeclarativeProperty.hasNotifySignal (<i>self</i>)</h3><p>Returns true if the property has a change notifier signal,
otherwise false.</p>


<h3 class="fn"><a name="index" />int QDeclarativeProperty.index (<i>self</i>)</h3><p>Return the Qt metaobject index of the property.</p>


<h3 class="fn"><a name="isDesignable" />bool QDeclarativeProperty.isDesignable (<i>self</i>)</h3><p>Returns true if the property is designable, otherwise false.</p>


<h3 class="fn"><a name="isProperty" />bool QDeclarativeProperty.isProperty (<i>self</i>)</h3><p>Returns true if this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> represents a
regular Qt property.</p>


<h3 class="fn"><a name="isResettable" />bool QDeclarativeProperty.isResettable (<i>self</i>)</h3><p>Returns true if the property is resettable, otherwise false.</p>


<h3 class="fn"><a name="isSignalProperty" />bool QDeclarativeProperty.isSignalProperty (<i>self</i>)</h3><p>Returns true if this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> represents a
QML signal property.</p>


<h3 class="fn"><a name="isValid" />bool QDeclarativeProperty.isValid (<i>self</i>)</h3><p>Returns true if the <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> refers to a
valid property, otherwise false.</p>


<h3 class="fn"><a name="isWritable" />bool QDeclarativeProperty.isWritable (<i>self</i>)</h3><p>Returns true if the property is writable, otherwise false.</p>


<h3 class="fn"><a name="method" /><a href="qmetamethod.html">QMetaMethod</a> QDeclarativeProperty.method (<i>self</i>)</h3><p>Return the <a href="qmetamethod.html">QMetaMethod</a> for this
property if it is a <a href="qdeclarativeproperty.html#Type-enum">SignalProperty</a>, otherwise
returns an invalid <a href="qmetamethod.html">QMetaMethod</a>.</p>


<h3 class="fn"><a name="name" />QString QDeclarativeProperty.name (<i>self</i>)</h3><p>Return the name of this QML property.</p>


<h3 class="fn"><a name="needsNotifySignal" />bool QDeclarativeProperty.needsNotifySignal (<i>self</i>)</h3><p>Returns true if the property needs a change notifier signal for
bindings to remain upto date, false otherwise.</p>
<p>Some properties, such as attached properties or those whose
value never changes, do not require a change notifier.</p>


<h3 class="fn"><a name="object" /><a href="qobject.html">QObject</a> QDeclarativeProperty.object (<i>self</i>)</h3><p>Returns the <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>'s <a href="qobject.html">QObject</a>.</p>


<h3 class="fn"><a name="property" /><a href="qmetaproperty.html">QMetaProperty</a> QDeclarativeProperty.property (<i>self</i>)</h3><p>Returns the <a href="qmetaproperty.html">Qt property</a>
associated with this QML property.</p>


<h3 class="fn"><a name="propertyType" />int QDeclarativeProperty.propertyType (<i>self</i>)</h3><p>Returns the <a href="qvariant.html">QVariant</a> type of the
property, or <a href="qvariant.html#Type-enum">QVariant.Invalid</a> if the property has
no <a href="qvariant.html">QVariant</a> type.</p>


<h3 class="fn"><a name="propertyTypeCategory" /><a href="qdeclarativeproperty.html#PropertyTypeCategory-enum">PropertyTypeCategory</a> QDeclarativeProperty.propertyTypeCategory (<i>self</i>)</h3><p>Returns the property category.</p>


<h3 class="fn"><a name="propertyTypeName" />str QDeclarativeProperty.propertyTypeName (<i>self</i>)</h3><p>Returns the type name of the property, or 0 if the property has
no type name.</p>


<h3 class="fn"><a name="read" />QVariant QDeclarativeProperty.read (<i>self</i>)</h3><p>Returns the property value.</p>


<h3 class="fn"><a name="read-2" />QVariant QDeclarativeProperty.read (<a href="qobject.html">QObject</a>, QString)</h3><p>Return the <i>name</i> property value of <i>object</i>. This
method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();
</pre>


<h3 class="fn"><a name="read-3" />QVariant QDeclarativeProperty.read (<a href="qobject.html">QObject</a>, QString, <a href="qdeclarativecontext.html">QDeclarativeContext</a>)</h3><p>Return the <i>name</i> property value of <i>object</i> using the
<a href="qdeclarativecontext.html">context</a> <i>ctxt</i>. This
method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> context);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();
</pre>


<h3 class="fn"><a name="read-4" />QVariant QDeclarativeProperty.read (<a href="qobject.html">QObject</a>, QString, <a href="qdeclarativeengine.html">QDeclarativeEngine</a>)</h3><p>Return the <i>name</i> property value of <i>object</i> using the
environment for instantiating QML components that is provided by
<i>engine</i>. . This method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> engine);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();
</pre>


<h3 class="fn"><a name="reset" />bool QDeclarativeProperty.reset (<i>self</i>)</h3><p>Resets the property and returns true if the property is
resettable. If the property is not resettable, nothing happens and
false is returned.</p>


<h3 class="fn"><a name="type" /><a href="qdeclarativeproperty.html#Type-enum">Type</a> QDeclarativeProperty.type (<i>self</i>)</h3><p>Returns the type of the property.</p>


<h3 class="fn"><a name="write" />bool QDeclarativeProperty.write (<i>self</i>, QVariant)</h3><p>Sets the property value to <i>value</i> and returns true.
Returns false if the property can't be set because the <i>value</i>
is the wrong type, for example.</p>


<h3 class="fn"><a name="write-2" />bool QDeclarativeProperty.write (<a href="qobject.html">QObject</a>, QString, QVariant)</h3><p>Writes <i>value</i> to the <i>name</i> property of
<i>object</i>. This method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);
</pre>


<h3 class="fn"><a name="write-3" />bool QDeclarativeProperty.write (<a href="qobject.html">QObject</a>, QString, QVariant, <a href="qdeclarativecontext.html">QDeclarativeContext</a>)</h3><p>Writes <i>value</i> to the <i>name</i> property of <i>object</i>
using the <a href="qdeclarativecontext.html">context</a>
<i>ctxt</i>. This method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> ctxt);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);
</pre>


<h3 class="fn"><a name="write-4" />bool QDeclarativeProperty.write (<a href="qobject.html">QObject</a>, QString, QVariant, <a href="qdeclarativeengine.html">QDeclarativeEngine</a>)</h3><p>Writes <i>value</i> to the <i>name</i> property of <i>object</i>
using the environment for instantiating QML components that is
provided by <i>engine</i>. This method is equivalent to:</p>
<pre class="cpp">
 <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> engine);
 p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);
</pre>


<h3 class="fn"><a name="__eq__" />bool QDeclarativeProperty.__eq__ (<i>self</i>, <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>)</h3><h3 class="fn"><a name="__hash__" />int QDeclarativeProperty.__hash__ (<i>self</i>)</h3><h3 class="fn"><a name="__ne__" />bool QDeclarativeProperty.__ne__ (<i>self</i>, <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>